# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=icon-naming-utils
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.8.90
pkgrel=2
pkgdesc="Maps the new names of icons for Tango to the legacy names used by the GNOME and KDE desktops (mingw-w64)"
arch=('any')
license=('GPL')
url="http://tango.freedesktop.org/"
depends=('perl-XML-Simple')
source=(http://tango.freedesktop.org/releases/${_realname}-${pkgver}.tar.gz
        remove-legacy-calc.patch)
sha256sums=('044ab2199ed8c6a55ce36fd4fcd8b8021a5e21f5bab028c0a7cdcf52a5902e1c'
            '35afd197c9259fe6142c38e34aa5d033b4285188c81218dc918dc0c81a115792')

prepare() {
  cd ${srcdir}/${_realname}-${pkgver}
  patch -Np1 -i "$srcdir/remove-legacy-calc.patch"
}

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  ./configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --sysconfdir=${MINGW_PREFIX}/etc \
    --libexecdir=${MINGW_PREFIX}/lib/icon-naming-utils \
    --localstatedir=${MINGW_PREFIX}/var
  make
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  mv "${pkgdir}${MINGW_PREFIX}/share/pkgconfig" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig"
}
